import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_hx/provider/application.dart';
import 'package:flutter_hx/services/app_theme_services.dart';
import 'package:flutter_hx/widgets/product_price_widget.dart';
import 'package:get/get.dart';

import 'cart_logic.dart';

class CartPage extends GetView<CartLogic> {
  const CartPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    final isWindow="1"==Get.parameters["isWindow"];
    return Scaffold(
      backgroundColor: AppThemeServices.appColors.background,
      appBar:AppBar(
        backgroundColor: AppThemeServices.appColors.background,
        automaticallyImplyLeading:isWindow,
        elevation: 0,
        title: Text("购物车",style: AppThemeServices.textTheme.appBarTitle),
        centerTitle: true,
        actions: [
          TextButton(
            onPressed: ()=>{
            },
            child: Text("编辑",style:AppThemeServices.textTheme.h14.copyWith(color: AppThemeServices.appColors.primarilyTextColor))
          )
        ],
      ),
      body: Column(
        children: [
          Expanded(
            child: EasyRefresh.custom(
              slivers: [],
            ),
          ),
          Container(
            padding: const EdgeInsets.symmetric(vertical: 9,horizontal: 15),
            color: Colors.white,
            child: Row(
              children: [
                Row(
                  children: [
                    Image.asset("assets/images/icon_check_normal.png"),
                    const SizedBox(width: 10),
                    Text("全选",style: AppThemeServices.textTheme.h12.copyWith(color: Colors.black))
                  ],
                ),
                Expanded(child: Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: [
                    Text("合计：",style: AppThemeServices.textTheme.h12.copyWith(color: Colors.black)),
                    ProductPriceWidget(1000.00,textColors: Colors.black,textFontSize: 17,prefixSize: 12),
                    const SizedBox(width: 10),
                    ElevatedButton(
                        onPressed: (){},
                        style: ElevatedButton.styleFrom(
                          primary: AppThemeServices.appColors.colorPrimary,
                          shadowColor: Colors.transparent,
                          elevation: 0,
                          shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(45)),
                          padding: const EdgeInsets.symmetric(vertical: 9,horizontal: 15)
                        ),
                        child: Text("去结算 (1)",style: AppThemeServices.textTheme.h13.copyWith(color: Colors.white)))
                  ]
                ))
              ],
            ),
          )
        ],
      ),
    );
  }
}
